package com.oop.ch07.user;

/**
 * 员工对象：数据库中的user表对应，user表中的字段和User类中的属性对应
 */
public class User{
	private int id;//user表的id
	private String name;//user表中的name
	private String sex;//user表中的sex
	private int age;//user表中的age
	
	public User() {
	}
	
	public User(int id, String name, String sex, int age) {
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.age = age;
	}
	
	
	//为什么需要toString这个方法：就是为了方便打印user对象中的属性的值
	@Override
	public String toString() {
		return "User{" + "id=" + id + ", name='" + name + '\'' + ", sex='" + sex + '\'' + ", age=" + age + '}';
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getSex() {
		return sex;
	}
	
	public void setSex(String sex) {
		this.sex = sex;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
}
